n, k = map(int,input().split())
sum = n * (n+1)
num = n // k
kind1 = k * (num+1)
kind2 = sum - kind1 * num
print(kind2)
print("%.1f %.1f" % (kind1/2, kind2/((n-num)<<1)))


